//
//  EGMMacro.h
//  EGMLibrary
//
//  Created by hh on 16/7/8.
//  Copyright © 2016年 egoman. All rights reserved.
//


#ifndef BleSports_EGMMacro_h
#define BleSports_EGMMacro_h

#define ADD_DYNAMIC_PROPERTY(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME) \
@dynamic PROPERTY_NAME ; \
static char kProperty##PROPERTY_NAME; \
- ( PROPERTY_TYPE ) PROPERTY_NAME \
{ \
    return ( PROPERTY_TYPE ) objc_getAssociatedObject(self, &(kProperty##PROPERTY_NAME ) ); \
} \
\
- (void) SETTER_NAME :( PROPERTY_TYPE ) PROPERTY_NAME \
{ \
    objc_setAssociatedObject(self, &kProperty##PROPERTY_NAME , PROPERTY_NAME , OBJC_ASSOCIATION_RETAIN); \
} \

//
//#define ADD_DYNAMIC_PROPERTY_RETAIN(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME) \
//ADD_DYNAMIC_PROPERTY(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME,OBJC_ASSOCIATION_RETAIN)
//
//#define ADD_DYNAMIC_PROPERTY_ASSIGN(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME) \
//ADD_DYNAMIC_PROPERTY(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME,OBJC_ASSOCIATION_ASSIGN)
//
//#define ADD_DYNAMIC_PROPERTY_COPY(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME) \
//ADD_DYNAMIC_PROPERTY(PROPERTY_TYPE,PROPERTY_NAME,SETTER_NAME,OBJC_ASSOCIATION_COPY)

#define GET_IOS_VERSION() [[[UIDevice currentDevice] systemVersion] floatValue]
#define GET_SCREEN_WIDTH() [UIScreen mainScreen].bounds.size.width
//app尺寸，去掉状态栏
//CGRect r = [ UIScreen mainScreen ].applicationFrame;
//状态栏尺寸
//CGRect rect; rect = [[UIApplication sharedApplication] statusBarFrame];

#define degreesToRadians(x) (M_PI*(x)/180.0) //把角度转换成PI的方式
#endif


